﻿using System;
using System.Data;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

/// <summary>
/// Summary description for CustomerBus
/// </summary>
public class CustomerBus
{
    private CustomerDAL customerDAL = new CustomerDAL();

	public CustomerBus()
	{
		//
		// TODO: Add constructor logic here
		//
	}

    public bool addCustomer(Customer objCus)
    {
        if (customerDAL.InsertCustomer(objCus))
            return true;
        else
            return false;
    }

    public DataTable getInfoCustomer(String _email, String _password)
    {
        return customerDAL.GetCustomerByEmail(_email,_password);
    }

    public bool checkLogin(String _email, String _password)
    {
        DataTable dt = new DataTable();
        dt = customerDAL.GetCustomerByEmail(_email,_password);
        if(dt.Rows.Count >0)
        {
            return true;
        }
        else
        {
            return false;
        }
    }
}
